import requests

from conftest import login_token
class Test_Yi():
    # 用例1 添加成功
    def test_address_01(self,login_token):
        url="http://172.17.8.100/small/user/verify/v1/addReceiveAddress"
        userid,sessionid=login_token
        # 请求头
        header={
            "userId":str(userid),
            "sessionId":sessionid
        }
        # 请求体
        body={
            "realName":"李扒皮",
            "phone":"17601535724",
            "address":"m78",
            "zipCode":"787878"
        }
        # 发送请求
        res = requests.post(url=url,headers=header,data=body)
        r=res.json()
        print(r)
        # 断言
        assert 200 == res.status_code
        assert "添加成功" == r['message']
        